package com.rizzo.analytics.domain.performance;

import java.io.Serializable;
import java.util.Comparator;

public class CallInfoTimeComparator implements Comparator<CallInfo>, Serializable {

    @Override
    public int compare(CallInfo o1, CallInfo o2) {
        if (o2.getTime().equals(o1.getTime())) {
            return o2.getDuration().compareTo(o1.getDuration());
        } else {
            return o2.getTime().compareTo(o1.getTime());
        }
    }
}
